//
//  DSLearnScoreCell.m
//  DSJY
//
//  Created by 冯华强 on 16/9/24.
//  Copyright © 2016年 dsjy. All rights reserved.
//  我的学习成绩

#import "DSLearnScoreCell.h"
#import "DSLearnScore.h"
#import "UIColor+Extension.h"

@interface DSLearnScoreCell ()
#pragma mark - 拖线属性
//时间2015-10-12 12:12:12
@property (weak, nonatomic) IBOutlet UILabel *dateLabel;
//课时
@property (weak, nonatomic) IBOutlet UILabel *courseLabel;
//练习（章节）
@property (weak, nonatomic) IBOutlet UILabel *chapterLabel;
//得分
@property (weak, nonatomic) IBOutlet UILabel *scoreLabel;
//用时(小时分秒)
@property (weak, nonatomic) IBOutlet UILabel *timeCostLabel;

@end

@implementation DSLearnScoreCell

#pragma mark - 设置UI
- (void)setLearnScore:(DSLearnScore *)learnScore
{
    _learnScore = learnScore;
    
    //设置值
    self.dateLabel.text = learnScore.learntime;
    self.courseLabel.text = learnScore.bookname;
    self.chapterLabel.text = learnScore.unitname;
    self.scoreLabel.text = learnScore.score;
    self.timeCostLabel.text = learnScore.usetimestr;
    
    //设置颜色
    if (learnScore.isfirst) {
        [self setupTextColor:[UIColor redColor]];
    }else{
        [self setupTextColor:[UIColor color333333]];
    }
    
}

- (void)setupTextColor:(UIColor *)textColor
{
    self.dateLabel.textColor = textColor;
    self.courseLabel.textColor = textColor;
    self.chapterLabel.textColor = textColor;
    self.scoreLabel.textColor = textColor;
    self.timeCostLabel.textColor = textColor;
}

@end
